//
//  ViewController.m
//  FrameAndBounds
//
//  Created by dllo on 16/6/4.
//  Copyright © 2016年 zuzhiming. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    [self createSubViews];
    
}

- (void)createSubViews
{
    //创建视图1, 添加到self.view上
    UIView *greenView = [[UIView alloc] initWithFrame:CGRectMake(20, 20, 200, 200)];
    greenView.backgroundColor = [UIColor greenColor];
    
    [self.view addSubview:greenView];
    [greenView release];
    
     //创建视图2, 添加到视图1上
    UIView *yellowView = [[UIView alloc] initWithFrame:CGRectMake(20, 20, 150, 150)];
    yellowView.backgroundColor = [UIColor yellowColor];
    
    [greenView addSubview:yellowView];
    [yellowView release];
    
    
    NSLog(@"greenView bounds: x: %lf, y: %lf, w: %lf h: %f", greenView.bounds.origin.x, greenView.bounds.origin.y, greenView.bounds.size.width, greenView.bounds.size.height);
    
    greenView.bounds = CGRectMake(0, 0, 200, 200);
   
}





- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
